/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.purpose.mapper;

import com.koron.purpose.domain.ContractTemplate;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ContractTemplateMapper {

    /**
     * insert contractTemplate
     * @param contractTemplate
     * @return
     */
    Integer insert(@Param("contractTemplate") ContractTemplate contractTemplate);


    /**
     * insert items in batch
     * @param contractTemplateList
     * @return
     */
    Integer batchInsert(@Param("contractTemplateList") List<ContractTemplate> contractTemplateList);


    /**
     * delete items in batch
     * @param idList
     * @return
     */
    Integer batchDetele(@Param("idList") List<String> idList);


    /**
     * update one template
     * @param contractTemplate
     * @return
     */
    Integer update(@Param("contractTemplate") ContractTemplate contractTemplate);

    /**
     * query the one whose id is the given
     * @param id
     * @return
     */
    ContractTemplate queryOne(@Param("id") String id);


    /**
     * fetch all items in the given condition
     * @param year
     * @param name
     * @param start
     * @param rows
     * @return
     */
    List<ContractTemplate> queryByCondition(@Param("year") String year, @Param("name") String name,
                                       @Param("start") Integer start, @Param("rows") Integer rows);


    /**
     * the number of items complying with the condition
     * @param year
     * @param name
     * @return
     */
    Integer countByCondition(@Param("year") String year, @Param("name") String name);



}
